The present invention is concerned with methods of producing object-based design description files for embroidery patterns from vector-based stitch files describing the pattern as a sequence of stitches.
It is known to use vector-based stitch files for controlling computer controlled embroidery machines. Such stitch files contain a sequence of individual stitch instructions to control the embroidery machine to move the needle in a specified co-ordinate direction prior to performing the next needle insertion. Apart from vector data, each stitch instruction may also include additional data for instructing the embroidery machine, e.g. to perform a thread color change, a jump stitch or a trim.
It is also known to use object-based design description files for embroidery pattern definition. Such files define areas of the embroidery pattern as software objects, which can then be easily manipulated for creating a new embroidery design or modifying an existing design. Once a design has been created or modified as an object-based design description file, conversion software create a vector-based stitch file from the object-based file and the vector-based stitch file is used to control the embroidery machine.
Typically, the object-based file consists of information describing geometric objects such as columns, lines, opaque or transparent complex polygons bounded by lines or curves, etc. and instructions for producing a stitch file from these objects. The additional instructions may include stitch densities, fill patterns, thread colors and compensation factors.
There is sometimes a requirement to modify an embroidery pattern for which the only available data is in the form of the vector-based stitch file. Since such a stitch file may consist of many thousands of vectors (as many as there are stitches in the embroidery pattern), modifying the stitch file to change the pattern would require changes to a very large number of these vectors. There is therefore a recognized need for methods, particularly software methods, for analyzing an existing vector-based stitch file and producing therefrom an object-based design description file which can then be readily manipulated by means of design software to modify an existing design.
EP-A-0221163 describes a method of producing a modified embroidery pattern for an embroidery machine in which a stitch-by-stitch definition of the embroidery pattern is analyzed to determine the stitch types, the area, the stitch lengths and the stitch spacings for each sequence of stitches in the pattern. According to the specification, the design represented by the pattern is then modified and a new series of stitch-by-stitch commands is produced for controlling the embroidery machine. However, there are no details as to how the stitch-by-stitch data is analyzed to enable the design to be varied as required.
EP-A-0545773 discloses a method of producing a new embroidery design from an existing design pattern in which vector-based stitch data are analyzed to identify the angle at each stitch point. Stitch runs are then defined based on a commonality of the angles for stitches of a stitch run having a particular stitch type. Outline points defining an outline of the stitch run are then selected which can be subsequently edited to produce a new embroidery design pattern. Essentially, the disclosed technique relies on identifying a sequence of stitches having a recognizable stitch type such as, satin stitching or tatami stitching (also known as fill stitching), and then identifying the outline of the region of the identified stitch type to allow subsequent editing of the overall pattern.
The present invention provides a method of operating a computer to produce an object-based design description file for an embroidery pattern, from a vector-based stitch file describing the pattern as a sequence of stitches, the method comprising the steps of analyzing the stitch file to identify stitch points qualifying as embroidery edge points at which the stitch direction substantially reverses, producing a list of said identified edge points in the order of the corresponding stitch points in the stitch file, further analyzing the stitch file to identify groups of successive edge points in the list wherein the edge points of each group define a respective embroidery region containing only contiguous area filling type stitches, and generating from the co-ordinate positions of edge points in each identified group an object describing the respective embroidery region for the object-based design description file.
Whereas, the prior art ""773 specification looks for regions of a particular stitch type, the above-identified invention defines potential objects for the object-based design file by looking for stitch points which qualify as edges in the stitch pattern, at which the stitch direction substantially reverses. In this way objects are created for the design description file without limiting these objects to regions of a single stitch type, such as SATIN or FILL. This has considerable advantages because a single embroidery region of an embroidery pattern may be filled with contiguous area filling type stitches of different types, for example the narrower parts of the region may contain SATIN stitching whereas the broader parts may contain FILL stitching. It is generally desirable for any one object of the object-based design description file to describe as large an area of the embroidery pattern as possible, it being understood that each object would normally be a region of consistent contiguous area filling stitches of the same color and bounded by a continuous outline. Preferably, the stitch points qualifying as embroidery edge points are identified by
a) identifying as simple edge points stitch points for which the stitch angle between the stitches on either side of the respective stitch point is smaller than a precalculated threshold value, and
b) finding pairs of consecutive stitch points forming a complex edge in which the aggregate stitch angle of the respective pair is less than a precalculated threshold value and identifying the stitch point of each said pair which has the smallest stitch angle as a complex edge point.
The aggregate stitch angle of the pair of stitch points forming a complex edge means the angle between the stitch line up to the first of the pair of stitch points forming the complex edge and the stitch line after the second of the pair. Thus the value of the aggregate angle of the pair of stitch points is the difference between 180xc2x0 and the sum of the stitch angles at each of the stitch points of the pair forming the complex edge.
Many embroidery patterns may contain such complex edge points, as well as simple edge points involving a simple substantial reversal of direction of stitching at an individual stitch point. By comparison complex edge points require two successive stitch points to accommodate a substantial reversal of the stitch direction. In a complex edge, the stitch angle at each of the two stitch points forming the complex edge may be greater than the precalculated threshold value for a simple edge point, but nevertheless the aggregate stitch angle is small indicating a substantial reversal of the stitch direction overall.
Preferably, said groups of edge points are identified by defining an edge point in the list as an end of group point if the edge point meets at least one of a set of group termination conditions, said set of group termination conditions including at least one of:
a) the nearest following stitch point which forms at least part of an identified edge is not preceded in the sequence of stitches in the stitch file by a run stitch or another stitch point forming at least part of an identified edge;
(b) the edge angle of the edge point has the same sign as the immediately preceding edge point in the list, the edge angle being the angle described at the respective edge point between the line from the preceding edge point to the line to the next edge point;
(c) the edge length from the edge point to the next edge point in the list differs by more than a predetermined fraction from the preceding edge length from the edge point to the preceding edge point; or
(d) the co-ordinates of the edge point are substantially the same as the co-ordinates of the next but one edge point in the list.
The functions of these conditions will be explained later herein.
In a preferred embodiment, the identified groups of edge points are categorized as FILL-type if less than a predetermined percentage less than 30% of the edge points in a respective said group correspond to consecutive stitches in the stitch file, and are otherwise categorized as SATIN-type. The group category as identified above is subsequently used for defining the object relating to the respective group.
A FILL-type group normally has a single consistent FILL angle which is determined by taking an average of the angles relative to a predetermined co-ordinate direction of the edge lines between consecutive edge points, over at least a central portion of the edge points of the group. Again the FILL angle determined in this way is used for defining the eventual object.
For a simple edge point, the line used for taking said average is the line through the simple edge point bisecting the line joining the respective preceding and following edge points.
Preferably, two identified groups of the same type which directly follow one another in the edge point list are merged to form a single group if the two groups meet predetermined merge criteria. This procedure allows regions of the embroidery pattern which could originally have been described by a single object, but which have been separated in the conversion process into two groups of edge points to be joined together again to form a single group, resulting in a single object in the final design description file.
In another aspect, the invention provides a method of operating a computer to produce an object-based design description file for an embroidery pattern, from a vector-based stitch file describing the pattern as a sequence of stitches, the method comprising the steps of:
analyzing the stitch file to identify groups of successive stitches in the stitch file which correspond to respective embroidery regions containing only contiguous area filling type stitches,
defining outlines of the embroidery regions from the co-ordinate portions of selected stitch points from the respective groups of stitches,
merging the outlines of embroidery regions corresponding to successive said groups in the stitch file, if the successive said groups meet predetermined merge criteria, to define merged outlines,
and generating from said merged outlines and remaining unmerged outlines corresponding objects describing the respective embroidery regions for the object-based design description file.
Procedures for identifying objects from stitch files, such as described above, commonly divide areas of embroidery design which may originally have been represented by a single object into a number of fragmented objects. The merging method described above ameliorates this effect.
Preferably, said identified groups and their corresponding outlines are classified as SATIN-type comprising primarily SATIN stitches, or FILL-type comprising stitches forming a consistent fill angle between the mean stitch direction and a predetermined co-ordinate direction, and said predetermined merge criteria includes the requirement that the outlines to be merged must be of the same group.
Then, for FILL-type outlines the predetermined merge criteria may include at least one of:
a) the fill angles of the outlines to be merged must not deviate by more than a predetermined threshold;
b) the outlines to be merged must not overlap by more than a predetermined amount at the end of the first outline and the beginning of the second outline;
c) the fill density, being the number of stitches per unit length along a direction orthogonal to the mean stitch direction, of each of the outlines to be merged must not deviate by more than a predetermined amount; and
d) the outlines to be merged must not be interrupted by a color change stitch.
Conveniently, each FILL-type outline is defined by a sequence of co-ordinate points around the outline, and the merge criteria further include that two consecutive connection points, forming a connection line, on each of outlines to be merged, must be identified for which connection conditions must be met including at least one of:
i) the angle between the connection lines must not exceed a predetermined value;
ii) the angle of each of the connection lines to said predetermined co-ordinate direction must not deviate from the respective fill angle by more than a predetermined amount;
iii) the length of the normal from the centre of one said connection line to the point of intersection with the other line must not exceed a predetermined value; and
iv) the length of each connection line must be greater than a predetermined value.
Then, FILL-type outlines satisfying the merge criteria may be merged by inserting, between the identified connection points in the sequence of points of one outline, the sequence of co-ordinate points between the identified connection points of the other outline, to define a new sequence of co-ordinate points defining the merged outline.
Conveniently, the order of the sequence of co-ordinate points inserted is selected so that lines connecting the adjacent connection points in the new sequence do not intersect.
For SATIN-type outlines, the predetermined merge criteria may include at least one of:
a) there must be fewer than a predetermined number of stitches in the stitch file between outlines to be merged;
b) the outlines to be merged must not overlap by more than a predetermined proportion of the stitch points at the edges of the outlines;
c) if there are more than two stitches between outlines to be merged, the stitch densities of the outlines must not differ by more than a predetermined threshold; and
d) the outlines to be merged must not be interrupted by a color change stitch.
Conveniently, each SATIN-type outline is defined by a first sequence of co-ordinate points down one side edge of the outline and a second sequence of co-ordinate points down the other side edge of the outline, and the merge criteria further include that, for first and second outlines to be merged, the last co-ordinate points of said first and second sequences of the first outline and the first co-ordinate points of said first and second sequences of the second outline form respective connection lines which must not differ in length by more than a predetermined fraction, and must not be spaced laterally by more than a predetermined distance.
Then, preferably, SATIN-type outlines satisfying the merge criteria are merged by adding said first sequences of the second outline to the end of a selected one of the sequences of the first outline and adding said second sequence of the second outline to the end of the other of the sequences of the first outline, so as to form first and second sequences of co-ordinate points defining the respective side edges of the merged outline.
The invention also provides computer apparatus programmed to produce an object-based design description file for an embroidery pattern from a vector-based stitch file describing the pattern as a sequence of stitches by processing the stitch file in accordance with the above-described method.
The invention still further contemplates a computer readable data carrier containing program instructions which control a computer to perform the above-described method.
Still further, the invention provides a computer readable data carrier containing an object-based design description file for an embroidery pattern, which file has been produced by the above-described method. The object-based design description file may of course have been further modified using embroidery design software operating on the object-based file.
The invention still further provides a computer readable data carrier containing a vector-based stitch file created from an object-based design description file for an embroidery pattern produced by the above-described method.
The invention still further provides a computer controlled embroidery machine controlled by a vector-based stitch file created from an object-based design description file for an embroidery pattern produced by the above-described method.